#coding=utf-8
__author__ = 'Administrator'

import os
import time

class Adsl(object):
    def __init__(self,act,pwd):
        self.name = 'adsl'
        self.account = act
        self.password = pwd

    #----------set value-------------
    def setAccount(self,act,pwd):
        self.account = act
        self.password = pwd

    #----------connect---------------
    def connect(self):
        cmd = "rasdial %s %s %s" %(self.name,self.account,self.password)
        os.system(cmd)
        time.sleep(3)

    #----------disconnect------------
    def disconnect(self):
        cmd = "rasdial %s /disconnect" % self.name
        os.system(cmd)
        time.sleep(3)

    #----------reconnect-------------
    def reconnect(self):
        self.disconnect()
        self.connect()